<template>
    <el-row>
        <!-- 利润 -->
        <el-col :span="24">
            <profit />
        </el-col>

        <!-- 手数 -->
        <el-col :span="24">
            <hand-count />
        </el-col>

        <!-- 净值 -->
        <el-col :span="24">
            <net-worth />
        </el-col>

        <!-- 浮盈/浮亏 -->
        <el-col :span="24">
            <floating-profit-and-loss />
        </el-col>

        <!-- 盈亏与分析 -->
        <!-- <el-col :span="24">
            <analyze-profit-and-loss />
        </el-col> -->

        <!-- 单笔盈亏 -->
        <!-- <el-col :span="24">
            <a-single-profit-or-loss />
        </el-col> -->

        <!-- 品种 -->
        <el-col :span="24">
            <breed />
        </el-col>
    </el-row>

</template>

<script>
import Profit from './profit.vue';
import HandCount from './handCount.vue';
import NetWorth from './netWorth.vue';
import FloatingProfitAndLoss from './floatingProfitAndLoss.vue';
import AnalyzeProfitAndLoss from './analyzeProfitAndLoss.vue';
import ASingleProfitOrLoss from './aSingleProfitOrLoss.vue';
import Breed from './breed.vue';

import { getTraderAnalysis } from '@/api/trainerAnalyze'


export default {
    props: ['uid', 'traderAccountId'],
    components: {
        Profit,
        HandCount,
        NetWorth,
        FloatingProfitAndLoss,
        AnalyzeProfitAndLoss,
        ASingleProfitOrLoss,
        Breed
    },
    data() {
        return {
            graphicsData: {
                commodityGraphVo: {
                    commodityName: '',
                    directions: ''
                },
                floatingProfitAndLossGraph: {
                    dataDay: [],
                    timeline: [],
                    dataSum: []
                },
                profitGraph: {
                    dataDay: [],
                    timeline: [],
                    dataSum: []
                },
                volumeGraph: {
                    dataDay: [],
                    timeline: [],
                    dataSum: []
                }
            }
        }
    },
    mounted() {

        let data = {
            uid: this.$route.query.uid,
            traderAccountId: this.$route.query.traderAccountId
        }
        getTraderAnalysis(data).then(res => {

            console.log('图表数据：',res)
            localStorage.setItem('graphicsData', JSON.stringify(res))
        }).catch(err => {
            console.log(err)
        })

    }
}
</script>
<style lang="scss" scoped></style>